package com.learn.springboot3.config;

import com.learn.springboot3.intercept.MyHandleInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * ClassName: WebConfig
 * Package: com.learn.springboot3.config
 * Description:
 *
 * @Author jiangCheng
 * @Create 2024/10/24 15:44
 * @Version 1.0
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private MyHandleInterceptor myHandleInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(myHandleInterceptor).addPathPatterns("/**");
    }
}
